﻿
Partial Class NewCustomer
    Inherits System.Web.UI.Page
    Private Sub MessageBox(ByVal pstrMsg As String)

        Dim lbl As New Label()

        lbl.Text = " <script language=""javascript""> " & _
        "window.alert('" + pstrMsg + "'); </script> "

        Page.Controls.Add(lbl)
    End Sub

    Protected Sub Submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Submit.Click
        Dim ID As String = Request.QueryString("key").ToString()
        MessageBox("1 record added")
        If ID = "1" Then
            TBname.Text = ""
            TBaddress.Text = ""
            TBemail.Text = ""
            TBname.Text = ""
            TBnric.Text = ""

        ElseIf ID = "2" Then
            Response.Write("<script language='javascript'>alert" _
    & "('Customer is added.'); document.location.href='./NewItem.aspx';<" & "/" & "script>")
        End If



    End Sub
End Class
